﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
using NServiceBus;
using NServiceBus.MessageMutator;
using NServiceBus.ObjectBuilder;

namespace Nservice.Api.Infastructure
{
    public class AccessMutators : IMutateOutgoingTransportMessages, INeedInitialization
    {
        public void MutateOutgoing(NServiceBus.Unicast.Messages.LogicalMessage logicalMessage, TransportMessage transportMessage)
        {
            transportMessage.Headers["access_token"] = "authentic_user";
        }



        public void Customize(BusConfiguration configuration)
        {
            configuration.RegisterComponents(c => c.ConfigureComponent<AccessMutators>(DependencyLifecycle.SingleInstance));
        }
    }
}